package com.ebt.m.fileExplore.util;

import com.ebt.m.fileExplore.model.ItemFile;

import java.text.Collator;
import java.util.Comparator;
//import com.google.common.collect.ComparisonChain;

public class CompareHelper {

	public static final Collator COLLATOR = Collator.getInstance();
	public static final Comparator<ItemFile> COMPARATOR_FILE_ITEM;
	
	static
	{
		COMPARATOR_FILE_ITEM = new Comparator<ItemFile>(){
			public final int compare(ItemFile a, ItemFile b){
				int compareType = COLLATOR.compare(String.valueOf(a.type), String.valueOf(b.type));
				return compareType == 0 ? COLLATOR.compare(a.name, b.name) : compareType;
			}
		};

	}
	
	private CompareHelper(){}
	
	
}
